#include "my_head.h"

bool UserSearch(p_user_node head)
{
    char s[20]={0};
    if(head==NULL)
    {
        printf("error\n");
        return false;
    }
    p_user_node p=head->next;
    printf("请输入你想要查询用户信息的用户名:");
    scanf("%s",s);
    while(p!=NULL&&strcmp(s,p->data.user_name)!=0)
    {
        p=p->next;
    }
    if(p!=NULL)
    {
        printf("用户角色为:%s\n",p->data.user_role);
        printf("用户的用户名为:%s\n",p->data.user_name);
        printf("用户账号为:%d\n",p->data.user_account.id);
        printf("用户密码为:%s\n",p->data.user_account.password);
        printf("用户权限为:%d\n",p->data.user_account.permission);
        printf("=============\n");
        return true;
    }else
    {
        printf("未找到该用户信息！\n");
        printf("=============\n");
        return false;
    }
}